<?php

namespace App;

use \App\Model;

class Comment extends Model
{
    protected $table = 'comments';
    //反向关联文章表
    public function belongsToPost(){
        return $this->belongsTo('App\Post','post_id','id');
    }

    //反向关联用户
    public function belongsToUser(){
        return $this->belongsTo('App\User','user_id','id');
    }
}
